let arr = [1, 2, 3]

const arr2 = arr.map(function (n) {
    return n + 1
})

const arr3 = arr.map((elem, index) => elem * index)

console.log(arr) // 1 2 3
console.log(arr2) // 2 3 4
console.log(arr3) // 0 2 6

const arr4 = arr.map((elem, index, arr)=> {
    console.log('当前值：' + elem)
    console.log('当前值对应的索引：' + index);
    console.log('原数组：' + arr);
    return elem * elem
})
console.log(arr4)
